import { subMonths, subQuarters, subYears } from "date-fns";

export function getDateRangeStartStamp(range: "year" | "quarter" | "month") {
  const now = new Date();
  switch (range) {
    case "year":
      return subYears(now, 1).valueOf();
    case "quarter":
      return subQuarters(now, 1).valueOf();
    case "month":
      return subMonths(now, 1).valueOf();
    default:
      return subMonths(now, 1).valueOf();
  }
}
